<? include($_SERVER['DOCUMENT_ROOT'] . "/wp-content/plugins/42A-autos/42autos-data.php"); ?>
<div class="my_meta_control">
  <label for="_my_meta[transmissie]">Transmissie</label>
  <p>
    <select name="_my_meta[autoAlgTransmissie]" id="_my_meta[autoAlgTransmissie]">
<? foreach ($autoAlgTransmissie as $key=>$value) { ?>
      <option<?php if($meta['autoAlgTransmissie'] == $key){ echo " selected=\"selected\" ";} ?> value="<? echo $key ?>"><? echo $value ?></option>
<? } ?>
    </select>
  </p>

  <label for="_my_meta[autoAlgVersnellingen]">Aantal versnellingen: <strong id="inputRangeValueVersnellingen"><? if(isset($meta['autoAlgVersnellingen'])){ echo $meta['autoAlgVersnellingen'];} else {echo "3";} ?></strong></label>
  <p>
    <input type="range" steps="1" class="versnellingen range" value="<? if(!isset($meta['autoAlgBouwjaar'])){ echo"3"; } else { $meta['autoAlgVersnellingen']; } ?>" min="3" max="6" name="_my_meta[autoAlgVersnellingen]" id="_my_meta[autoAlgVersnellingen]" />
    <script type="text/javascript">
      jQuery("input.versnellingen").change(function(){
        jQuery("#inputRangeValueVersnellingen").text(jQuery(this).val())
      })
    </script>
  </p>

  <label for="_my_meta[autoAlgBrandstof]">Brandstof type</label>
  <p>
    <select name="_my_meta[autoAlgBrandstof]" id="_my_meta[autoAlgBrandstof]">
<? foreach ($autoAlgBrandstof as $key=>$value) { ?>
      <option<?php if($meta['autoAlgBrandstof'] == $key){ echo " selected=\"selected\" ";} ?> value="<? echo $key ?>"><? echo $value ?></option>
<? } ?>
    </select>
  </p>

  <label for="_my_meta[autoAlgVermogen]">Vermogen (pk) <sup id="inputRangeValueKw">(<? if(isset($meta['autoAlgVermogen'])){ 
$getKw = $meta['autoAlgVermogen'] * 736 / 1000;
echo $getKw;} else {echo "0";} ?> kw)</sup></label>
  <p>
    <input type="text" name="_my_meta[autoAlgVermogen]" class="vermogen" value="<?php if(!empty($meta['autoAlgVermogen'])) echo $meta['autoAlgVermogen']; ?>"/>
    <script type="text/javascript">
      jQuery("input.vermogen").keyup(function(){
        var input = jQuery(this).val();
        var getKw = input * 736 / 1000;
        jQuery("#inputRangeValueKw").text("(" + getKw.toFixed(1) + " kw)")
      })
    </script>
  </p>


  <label for="_my_meta[autoAlgCilinderinhoud]">Cilinderinhoud (cm3)</label>
  <p>
    <input type="text" name="_my_meta[autoAlgCilinderinhoud]" value="<?php if(!empty($meta['autoAlgCilinderinhoud'])) echo $meta['autoAlgCilinderinhoud']; ?>"/>
  </p>

  <label for="_my_meta[autoAlgCilinders ]">Cilinders (aantal)</label>
  <p>
    <input type="text" name="_my_meta[autoAlgCilinders]" value="<?php if(!empty($meta['autoAlgCilinders'])) echo $meta['autoAlgCilinders']; ?>"/>
  </p>

  <label for="_my_meta[autoAlgGewicht]">Leeggewicht (kg)</label>
  <p>
    <input type="text" name="_my_meta[autoAlgGewicht]" value="<?php if(!empty($meta['autoAlgGewicht'])) echo $meta['autoAlgGewicht']; ?>"/>
  </p>

</div>